﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.ServiceModel;
using System.Runtime.Serialization;
using System.Collections;

namespace BattleshipContract
{
    public enum state { alive, death };
    public enum orientation { vertical, horizontal };
    public enum eventTypes { playerReady, playerTurn, playerShot, gamePaused, gameResumed, gameStopped, hit, missed };
    public enum playerTypes { player1, player2 };
    
    [ServiceContract(Namespace="BattleshipContract", CallbackContract=typeof(IGamePlayCallBack))]
    public interface IGamePlay
    {
        //List<Ship> shipList { get; set; }

        [OperationContract]
        void startGame(int playerId1, int playerId2);
        
        [OperationContract]
        void pauseGame();
        
        [OperationContract]
        void resumeGame();
       
        [OperationContract]
        void exitGame();

        [OperationContract]
        void Shoot(int playerId, Point position);

        //[OperationContract]
        //void Subscribe(eventTypes gameEvent);

        //[OperationContract]
        //void Unsubscribe(eventTypes gameEvent);
    }

    public interface IGamePlayEvents
    {
        [OperationContract(IsOneWay = true)]
        void onPlayerReady(int PlayerId, Point[] positions);
        [OperationContract(IsOneWay = true)]
        void onPlayerTurn(int PlayerId);
        [OperationContract(IsOneWay = true)]
        void onGamePaused();
        [OperationContract(IsOneWay = true)]
        void onGameResumed();
        [OperationContract(IsOneWay = true)]
        void onGameStopped();
        [OperationContract(IsOneWay = true)]
        void onGameHit();
        [OperationContract(IsOneWay = true)]
        void onGameMissed();

        /*
         public delegate void PlayerReadyhandler(int PlayerId, Point[] positions);
        public event PlayerReadyhandler PlayerReady;
        public delegate void PlayerTurnhandler(int PlayerId);
        public event PlayerTurnhandler PlayerTurn;
        public delegate void gameActionHandler();
        public event gameActionHandler gamePaused;
        public event gameActionHandler gameResumed;
        public event gameActionHandler gameStopped;
        public event gameActionHandler Hit;
        public event gameActionHandler Missed;
         */
    }
}
